<extend name="Public:base" />

<block name="content">
    <div class="row">
        <div class="col-lg-12">
            <h3 class="page-header"><em class="glyphicon glyphicon-cloud-upload"></em> 
            {$type}          
            </h3>            

            <nav class="navbar navbar-default">
                <div class="container-fluid">
                    <div class="navbar-header">
                        <span class="navbar-text">分组：</span>
                        <a href="{:U('index',array('groupid'=> 0))}" <if condition="$groupid eq 0">class="btn btn-sm btn-success navbar-btn"<else/>class="btn btn-sm btn-default navbar-btn"</if>>全部</a>
                        <foreach name='configgroup' item='v'>
                        <a href="{:U('index',array('groupid'=> $key))}" <if condition="$key eq $groupid">class="btn btn-sm btn-success navbar-btn"<else/>class="btn btn-sm btn-default navbar-btn"</if>>{$v}</a>&nbsp;
                        </foreach>
                    </div>
                </div>
            </nav>
        </div>
        
    </div>

    <div class="row margin-botton">
        <div class="col-sm-6 column">
            <div class="btn-group btn-group-md">
                <button class="btn btn-primary" type="button" onclick="goUrl('{:U('add')}')"><em class="glyphicon glyphicon-plus-sign"></em> 添加配置项</button>
                <button class="btn btn-default" type="button" onclick="doGoSubmit('{:U('sort')}','form_do')"><em class="glyphicon glyphicon-th-list"></em> 更新排序</button>
            </div>
        </div>
        <div class="col-sm-6 text-right">
            <if condition='ACTION_NAME eq "index"'>
                <form class="form-inline" method="post" action="{:U('index')}">
                  <div class="form-group">
                    <label class="sr-only" for="inputKeyword">关键字</label>
                    <input type="text" class="form-control" name="keyword" id="inputKeyword" placeholder="关键字" value="{$keyword}">
                  </div>
                  <button type="submit" class="btn btn-default">搜索</button>
                </form>
            </if>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-12">
            <form action="" method="post" id="form_do" name="form_do">
                <div class="table-responsive">
                    <table class="table table-hover xyh-table-bordered-out">
                        <thead>
                            <tr class="active">
                                <th>编号</th>
                                <th>名称</th>
                                <th>标题</th>
                                <th>分组</th>
                                <th>类型</th>
                                <th>排序</th>
                                <th class="text-right">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                        <foreach name='vlist' item='v'>
                        <tr>
                            <td>{$v.id}</td>
                            <td class="aleft">{$v.name}</td>
                            <td >{$v.title}</td>
                            <td>{$v.groupid|get_item_value='configgroup',###}</td>                
                            <td>{$v.typeid|get_item_value='configtype',###}</td>
                            <td><input type="text" name="sortlist[{$v.id}]" value="{$v.sort}" id="sortlist" size="5" class="xyh-form-" /></td>
                            <td class="text-right">
                                <a href="{:U('edit',array('id' => $v['id']))}" class="label label-success">编辑</a>
                                <a href="javascript:;" onclick="toConfirm('{:U('del', array('id' => $v['id']))}', '确实要删除吗？')" class="label label-danger">删除</a>
                            </td>
                        </tr>
                        </foreach>
                        </tbody>
                    </table>
                </div>
            </form>

            <div class="row clearfix">
                <div class="col-md-12 column">
                    <div class="xyh-page">
                        {$page}
                    </div>
                </div>
            </div>

            
        </div>
    </div>

    </block>